/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package comandaXM.accions;

import comandaXM.classes.manteniment.auxiliar.*;
import comandaXM.excepcions.ExceptionHibernate;
import comandaXM.model.manteniment.auxiliars.AuxiliarModel;
import java.util.List;

/**
 *
 * @author xmarti
 */
public class AuxiliarsAct {
    private AuxiliarModel model; 
    public AuxiliarsAct (){
        this.model= new AuxiliarModel() ; 
    }
    
    public List<Pais> getPaisos() throws ExceptionHibernate {        
        return model.getListPaisos();
    } 
    public List<Pais> getPaisos(String textToSearch) throws ExceptionHibernate{
        return model.getListPaisos(textToSearch); 
    }
    public List<Provincia> getProvincies() throws ExceptionHibernate {        
        return model.getListProvincies();
    }
    public List<Provincia> getProvincies(String textToSearch) throws ExceptionHibernate {        
        return model.getListProvincies(textToSearch);
    }
    public List<TipusIva> getTipusIvaActive() throws ExceptionHibernate{
        List<TipusIva> temp = model.getListTipusIvaActive();
        temp.add(0,null);
        return temp; 
    }
    public List<TipusIva> getTipusIva(String textToSearch) throws ExceptionHibernate{
        return model.getListTipusIva(textToSearch);
    }
    public List<TipusPagament> getTipusPagamentActive() throws ExceptionHibernate{
        List <TipusPagament> temp =  model.getListTipusPagamentActive();
        temp.add(0,null);
        return temp;
    }
    public List<TipusPagament> getTipusPagament(String textToSearch) throws ExceptionHibernate{
        return model.getListTipusPagament(textToSearch); 
    }
   public int add (Pais object) throws ExceptionHibernate{       
        return model.add(object);
    }
   public int add (Provincia object) throws ExceptionHibernate{       
        return model.add(object);
    }
   public int add (TipusIva object) throws ExceptionHibernate{       
        return model.add(object);
    }
   public int add (TipusPagament object) throws ExceptionHibernate{       
        return model.add(object);
    }
   public boolean update (Object object) throws ExceptionHibernate{       
        return model.update (object);
    }
    public boolean delete(Object object) throws ExceptionHibernate{
        return model.delete(object);
    }
    
}
